]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell/app: Remove some dead code
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 6 Jun 2024 13:31:34 +0000 (15:31 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 13 Jun 2024 18:21:01 +0000 (18:21 +0000)
`g_desktop_app_info_launch_uris_as_manager_with_fds()` was added
in GIO 2.57.2. We now depend on at least 2.79.2, so we no longer
need a fallback path for the case the function isn't available.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3361>

config.h.meson
meson.build
src/shell-app.c

index 5ad68d8395040070904b479412689216c00496e2..914fc2ebd8ea669adfea6454dca187904e9e2507 100644 (file)
@@ -31,9 +31,6 @@
 /* Define if _NL_TIME_FIRST_WEEKDATE is available */
 #mesondefine HAVE__NL_TIME_FIRST_WEEKDAY
 
-/* Define if you have the `g_desktop_app_info_launch_uris_as_manager_with_fds` function */
-#mesondefine HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS
-
 /* Define if fdwalk is available in libc */
 #mesondefine HAVE_FDWALK
 
index d3e5a461b01ee31b82a312641db9b020f14f5629..0b265ad922049e483038d19887f3cb45e3ef0a05 100644 (file)
@@ -146,11 +146,6 @@ cdata.set('HAVE_NETWORKMANAGER', have_networkmanager)
 cdata.set('HAVE_PIPEWIRE', have_pipewire)
 cdata.set('HAVE_SYSTEMD', have_systemd)
 
-# New API added in glib-2.57.2
-cdata.set('HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS',
-          cc.has_function('g_desktop_app_info_launch_uris_as_manager_with_fds',
-                          dependencies : gio_dep)
-)
 cdata.set('HAVE_FDWALK', cc.has_function('fdwalk'))
 cdata.set('HAVE_MALLINFO', cc.has_function('mallinfo'))
 cdata.set('HAVE_MALLINFO2', cc.has_function('mallinfo2'))
index dcebc97daf59ce9a9a32b257001609868461d5cf..9bea3e34707a5af484f1faf42765430ac60d7a73 100644 (file)
@@ -1241,33 +1241,6 @@ child_context_setup (gpointer user_data)
   meta_context_restore_rlimit_nofile (meta_context, NULL);
 }
 
-#if !defined(HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS) && defined(HAVE_SYSTEMD)
-/* This sets up the launched application to log to the journal
- * using its own identifier, instead of just "gnome-session".
- */
-static void
-app_child_setup (gpointer user_data)
-{
-  const char *appid = user_data;
-  int res;
-  int journalfd = sd_journal_stream_fd (appid, LOG_INFO, FALSE);
-  ShellGlobal *shell_global = shell_global_get ();
-
-  if (journalfd >= 0)
-    {
-      do
-        res = dup2 (journalfd, 1);
-      while (G_UNLIKELY (res == -1 && errno == EINTR));
-      do
-        res = dup2 (journalfd, 2);
-      while (G_UNLIKELY (res == -1 && errno == EINTR));
-      (void) close (journalfd);
-    }
-
-  child_context_setup (shell_global);
-}
-#endif
-
 static void
 wait_pid (GDesktopAppInfo *appinfo,
           GPid             pid,
@@ -1381,7 +1354,6 @@ shell_app_launch (ShellApp           *app,
   flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD |
           G_SPAWN_LEAVE_DESCRIPTORS_OPEN;
 
-#ifdef HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS
   /* Optimized spawn path, avoiding a child_setup function */
   {
     int journalfd = -1;
@@ -1403,18 +1375,6 @@ shell_app_launch (ShellApp           *app,
     if (journalfd >= 0)
       (void) close (journalfd);
   }
-#else /* !HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS */
-  ret = g_desktop_app_info_launch_uris_as_manager (app->info, NULL,
-                                                   context,
-                                                   flags,
-#ifdef HAVE_SYSTEMD
-                                                   app_child_setup, (gpointer)shell_app_get_id (app),
-#else
-                                                   child_context_setup, shell_global,
-#endif
-                                                   wait_pid, NULL,
-                                                   error);
-#endif /* HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS */
   g_object_unref (context);
 
   return ret;